package com.koron.ticket.work.common.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.koron.ticket.work.workPermit.bean.WorkPermit;
import com.koron.ticket.work.workend.bean.WorkEnd;
import com.koron.ticket.work.workflow.bean.WorkFlow;
import com.koron.ticket.work.workinfo.bean.WorkInfo;
import com.koron.ticket.work.worklocation.bean.WorkLocationBean;
import com.koron.ticket.work.workmember.bean.WorkMember;
import com.koron.ticket.work.workteam.bean.WorkTeam;
import com.koron.ticket.work.workticket.bean.WorkTicket;
import com.koron.ticket.workchange.ticketchange.bean.TicketChange;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * 包含七张表的对象实例, 以及一个关联实例
 * 1. 工作票主票-w_ticket_work
 * 2. 工作票详情-w_ticket_work_info
 * 3. 工作班组-w_ticket_work_team
 * 4. 工作班组成员-w_ticket_work_member
 * 5. 签名-w_ticket_work_flow
 * 6. 待许可信息-w_ticket_work_permit
 * 7. 终结信息-w_ticket_work_end
 * 8. 当前用户的相关信息
 * 9. 工作变更项- TicketChange:包含w_ticket_change_director/content/delay/director/interrupt/member/securityarrangement 的数据
 *
 */
@Data
public class FourteenTables {

    // 1. 工作票主票
    @ApiModelProperty(value = "工作票主票")
    private WorkTicket workTicket;

    // 2. 工作票详情
    @ApiModelProperty(value = "工作票详情")
    private WorkInfo workInfo;

    // 3. 工作班组
    @ApiModelProperty(value = "工作班组")
    private List<WorkTeam> workTeamList;

    // 4. 工作班组成员
    @ApiModelProperty(value = "工作班组成员")
    private List<WorkMember> workMemberList;

    // 5. 签名信息
    @ApiModelProperty(value = "签名信息")
    private List<WorkFlow> workFlowList;

    // 6. 待许可信息
    @ApiModelProperty(value = "待许可信息")
    private WorkPermit workPermit;

    // 7. 终结信息(工作待终结+工作票待终结)
    @ApiModelProperty(value = "终结信息")
    private List<WorkEnd> workEndList;

    // 8. 当前用户信息
    @ApiModelProperty(value = "创建人名称")
    private String createByName;

    @ApiModelProperty(value = "创建人")
    private String createBy;

    @ApiModelProperty(value = "创建单位ID", hidden = true)
    private String deptId;

    // 9. 工作地点
    @ApiModelProperty(value = "工作地点")
    private List<WorkLocationBean> workLocationList;

    //ApiModelProperty(value = "创建单位")

    @ApiModelProperty(value = "创建人时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date createTime;

    // 9. 工作票变更信息
    @ApiModelProperty(value = "工作票变更")
    private TicketChange ticketChange;


}
